package com.jurenzhao.partssystem.information.basic_model.controller;


import com.jurenzhao.partssystem.information.basic_model.entity.BasicModel;
import com.jurenzhao.partssystem.information.basic_model.service.BasicModelService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/model")
public class BasicModelController {
    @Resource
    private BasicModelService basicModelService;
    @RequestMapping("/list/{seriesId}")
    public String findModelBySeriesId(Model model,@PathVariable int seriesId){
        List<BasicModel> models = basicModelService.findModelBySeriesId(seriesId);
        System.out.println("=============="+models);
        model.addAttribute("models",models);
        return "/information/BasicModel/BasicModel_List";
    }


}
